import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { AppShortcut } from '../../native/shortcut';
import { Loading } from '../../components/loading';

@Component({
  selector: 'page-list',
  templateUrl: 'list.html'
})
export class ShortcutsPage {

  shortcuts: Array<any>;

  constructor(
    public navCtrl: NavController, 
    public navParams: NavParams,
    private shorcut: AppShortcut,
    private loading: Loading,
    ) {
    this.loading.presentLoading();
    this.shorcut.shortcuts()
    .then((res: any) => {
      this.shortcuts = res;
      console.log(res);
      this.loading.dismiss();
    })
    .catch((error: any) => console.error(error));
  }
}
